package com.example.bankend.mapper;



import com.example.bankend.model.BankCard;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CardMapper {
    int insert(BankCard card);

    int deleteByPrimaryKey(String cardID);

    int updateByPrimaryKey(BankCard card);
    //修改密码
    int updatePassByCardID(BankCard bankCard);
    BankCard selectByPrimaryKey(String cardID);
    int updateBalanceByCardID(@Param("cardID") String cardID, @Param("amount") Double amount);


    List<BankCard> selectAll();

    List<BankCard> getCardsByUsername(@Param("username") String username);
    // 新增查询总余额的方法
    Double getTotalBalance();

    // 新增查询银行卡总数的方法
    int getTotalCards();

}